/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * TrainingBook
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * Projects is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Projects is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _USER_DAY_HPP_
#define _USER_DAY_HPP_

#include <DateTime.hpp>
#include <libxml++/libxml++.h>
#include <fstream>
#include <iostream>

///@class UserDay
///@brief Defines the values for a given day for the user
class UserDay
{
    public:
        ///@brief Default constructor
        UserDay();
        ///@brief Copy contructor
        UserDay(const UserDay&);
        ///@brief Destructor
        ~UserDay();
        ///@brief Overload of = operator
        UserDay &operator=(const UserDay&);

        //Getters
        ///@brief Return the date and time
        DateTime GetDate() const;
        ///@brief Return the weight
        double GetWeight() const;
        ///@brief Return the hegight in meters
        double GetHeight() const;
        ///@brief Return the humor index
        unsigned int GetHumor() const;
        ///@brief Return the sensations index
        unsigned int GetSensations() const;
        ///@brief Return the rest heart rate
        unsigned int GetRestHR() const;
        ///@brief Return the maximum heart rate
        unsigned int GetMaxHR() const;

        //Setters
        ///@brief Set the date and time
        void SetDate(DateTime);
        ///@brief Set the weight
        void SetWeight(double);
        ///@brief Set the height
        void SetHeight(double);
        ///@brief Set the humor index
        void SetHumor(unsigned int);
        ///@brief Set the sensations index
        void SetSensations(unsigned int);
        ///@brief Set the rest hearth rate
        void SetRestHR(unsigned int);
        ///@brief Set the maximum hearth rate
        void SetMaxHR(unsigned int);
        

        ///@brief Read informations from a XML node
        void ReadXMLNode(xmlpp::Node*);
        ///@brief Write to XML file
        void WriteXML(std::ofstream&);

        ///@brief Overload of << operator
        friend std::ostream &operator << (std::ostream&, const UserDay&);
    protected:

    private:
        ///@brief Date and time
        DateTime date;
        ///@brief Weight in kg
        double weight;
        ///@brief Height in meters
        double height;
        ///@brief Humor index
        unsigned int humor;
        ///@brief Sensations index
        unsigned int sensations;
        ///@brief Hearth rate at rest
        unsigned int restHR;
        ///@brief Maximum heart rate
        unsigned int maxHR;
};

#endif // _USER_DAY_HPP_
